<?php
use yii\helpers\Url;
use lemon\repository\BaseCookie;

//全局javascript变量
$context = $this->context;
$message = $context->message;
$flag = $context->operate;
$params = Yii::$app->params;
$file_http = base64_encode(json_encode($params['FILE_HTTP_PATH'], 320));
$file_upload = base64_encode(json_encode(Url::toRoute($params['FILE_UPLOAD_URL'], 320)));
$upload_lan = BaseCookie::get('upload_lan')?1:0;

if(!empty($message)){
	$message = str_replace(array("\r\n", "\r", "\n"), '', $message);
	$message = str_replace('"', "'", $message);
}
?>
<script type="text/javascript">
var MESSAGE = "<?=$message?>";
var MESSAGE_FLAG = "<?=$flag?>";
var PATH_PARAM = eval('('+window.atob('<?=$file_http ?>')+')');
var UPLOAD_PARAM = eval('('+window.atob('<?=$file_upload ?>')+')');
var NETWORK_LAN = "<?=$upload_lan ?>"
</script>